Skip to content

fix: keep updater Store boundary nominal / 保持 updater 的 Store 静态边界 - #36

Merged
tiye merged 1 commit into
mainfrom
fix/static-store-boundary
Sep 2, 2026
Merged

fix: keep updater Store boundary nominal / 保持 updater 的 Store 静态边界#36
tiye merged 1 commit into
mainfrom
fix/static-store-boundary

Conversation

@tiye

@tiye tiye commented Sep 2, 2026

Copy link
Copy Markdown
Member

English

Summary

  • Treat raw-store in app.updater/updater as the nominal Store already guaranteed by its function schema and Reel's updater contract.
  • Remove the redundant struct? / unsafe-coerce / decode-map-as branch that reinterpreted an already-decoded Struct as an external Map.
  • Keep decode-map-as in hydrate-storage, where persisted legacy data actually crosses into the typed application.

Why

The stricter compiler correctly rejects decode-map-as when the input is already a Store Struct (E_DECODE_MAP_AS_ALREADY_STRUCT). Re-decoding here also obscures the true dynamic boundary and caused history navigation to fail before the updater handled the operation.

Validation

  • calcit calcit.cirru edit format — no formatting changes.
  • calcit calcit.cirru --check-only — passed with Calcit 0.13.72.
  • calcit calcit.cirru js — passed.
  • yarn vite build --base=./ — passed (301 modules).
  • calcit calcit.cirru analyze quality --baseline config/calcit-quality.json — passed; no quality metric increased.
  • With the compiler from feat: stable nominal callables and typed literal paths / 稳定 nominal callable 与类型化字面量路径 calcit-lang/calcit#591 and config modules pointing directly at local Respo/alerts#60, the previous E_DECODE_MAP_AS_ALREADY_STRUCT failure is gone. Remaining findings are tracked Respo/Reel/JS-FFI migration work.

中文

摘要

  • app.updater/updater 直接把 raw-store 视为函数 schema 与 Reel updater 契约已经保证的 nominal Store
  • 删除多余的 struct? / unsafe-coerce / decode-map-as 分支,不再把已 decode 的 Struct 重新解释为外部 Map。
  • decode-map-as 继续保留在 hydrate-storage,因为持久化 legacy 数据是在那里真正进入类型化应用。

原因

严格编译器会正确拒绝对已经是 Store Struct 的输入再次调用 decode-map-asE_DECODE_MAP_AS_ALREADY_STRUCT)。该二次 decode 还掩盖了真实动态边界,并导致查看 history 时在 updater 处理操作前失败。

验证

Copilot AI lite review requested due to automatic review settings September 2, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is small, schema-aligned (updater already declares Store input), and removes a redundant decode path that the stricter compiler correctly rejects while retaining decoding at the true external boundary.

Pull request overview

This PR fixes a strict-compiler type error and a history-navigation failure by making app.updater/updater treat its raw-store input as the already-nominal app.schema/Store guaranteed by the updater schema/Reel contract, instead of attempting to re-decode it as a map.

Changes:

  • Remove the redundant struct? / unsafe-coerce / decode-map-as branch in app.updater/updater and bind store directly to raw-store.
  • Keep decode-map-as only at the :hydrate-storage boundary where legacy persisted data crosses into the typed app.
  • Add a history note documenting the rationale in both English and Chinese.
File summaries
File Description
calcit.cirru Simplifies updater store initialization to avoid re-decoding an already-typed Store and preserves decoding only at hydration.
history/202609021755-static-store-boundary.md Documents the motivation and boundary rationale for the updater store handling change.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tiye
tiye merged commit b1a43f8 into main Sep 2, 2026
2 checks passed
@tiye
tiye deleted the fix/static-store-boundary branch September 2, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants